package com.rst.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

@Entity
@Table(name="t_sections")
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class Section {
	
	public static final int ACTIVE = 1;
	public static final int INACTIVE = 0;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name="f_section_id")
	private Long sectionId;	
	
	@Column(name="f_name")
	private String name;
	
	@Column(name="f_status")
	private Integer status;
	
	@Column(name="f_class_id")
	private Long classId;

	@Temporal(TemporalType.DATE)
	@Column(name="f_start_date")
	private Date startDate;
	
	@Temporal(TemporalType.DATE)
	@Column(name="f_end_date")
	private Date endDate;

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="f_class_id", nullable=false, insertable=false, updatable=false)
	private Classe clas;

	
	public Long getSectionId() {
		return sectionId;
	}
	public void setSectionId(Long sectionId) {
		this.sectionId = sectionId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public Long getClassId() {
		return classId;
	}
	public void setClassId(Long classId) {
		this.classId = classId;
	}

	public Classe getClas() {
		return clas;
	}
	public void setClas(Classe clas) {
		this.clas = clas;
	}
	public Date getStartDate() {
		return startDate;
	}
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}	
	

}
